home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 237 / 237.d81 / t.free cell < prev    next >
Text File  |  2022-08-26  |  7KB  |  277 lines

  1. u
  2.           F R E E   C E L L
  3.            by Dave Moorman
  4.  
  5.  
  6.     This solitaire game is -- well --
  7. Free Cell. I tried to include many of
  8. the features found on the Windows
  9. version that comes with most PC
  10. computers. And I added a couple
  11. features of my own.
  12.  
  13.  
  14. STARTING THE GAME
  15. -----------------
  16.  
  17.     When you see the "empty" screen,
  18. click on START to start the game. You
  19. can click on X at the upper right
  20. corner of the screen (or press <X>) at
  21. any time to end the game.
  22.  
  23.     When you click START (or press
  24. <S>), you are presented with a Game
  25. Number. Click PLAY to accept that
  26. number, or CHANGE to choose a Game
  27. Number.
  28.  
  29.     Once the game has started,
  30. clicking START will allow you to
  31. Restart the game or start a new game.
  32.  
  33.  
  34. PLAYING THE GAME
  35. ----------------
  36.  
  37.     The object of Free Cell is to move
  38. all the cards from the tableau to the
  39. Stacks (at the top right of the
  40. screen), beginning with the Ace of
  41. each suit and piling to the King. The
  42. cards may be moved between columns of
  43. the tableau, one card at a time,
  44. placing a given card on a card with
  45. one higher value, with a different
  46. suit color.
  47.  
  48.     You have four "free cells" at the
  49. top left of the screen. Each can hold
  50. one card. By moving cards into the
  51. free cells, then back to the tableau,
  52. you can move columns of ordered cards
  53. from one column to another.
  54.  
  55.     To move a card, click on it. It
  56. will turn yellow. Then click on the
  57. column, free cell, or stack where you
  58. want to put the card.
  59.  
  60.     Double-clicking on a card will
  61. send it to a free cell, if one is
  62. open. If some of the cards in the
  63. chosen stack are in order, one of them
  64. being a legal move, and you have
  65. enough room in free cells and open
  66. columns, the whole column will be
  67. moved with just a point and click.
  68.  
  69.     The UNDO button at the top of the
  70. screen (or press <U>) will take back
  71. ONE move. If you get completely stuck,
  72. click START (press <S>) to Restart the
  73. game.
  74.  
  75.  
  76. UNIQUE FEATURES
  77. ---------------
  78.  
  79.     One of the reasons I wrote this is
  80. that my Windows game went kaput and I
  81. can't get it to work -- or find
  82. another copy to reinstall. I was
  83. miffed because I had successfully
  84. completed games numbered 1 through
  85. 829. My goal was, and still is, to win
  86. all 32000 games.
  87.  
  88.     So I added a feature to this
  89. version that makes such a Series Play
  90. easy to do. RIGHT CLICK on START when
  91. the screen is empty. The first time
  92. you do this, you can input your name
  93. to the list of players. Then you can
  94. choose to Play Game 1. Future games
  95. started with a right click will offer
  96. you your current Game Number. When you
  97. win, the Game Number is incremented.
  98.  
  99.     And, any number of people can keep
  100. track of their personal Series Play.
  101. To add a name, choose New Player. To
  102. move to an existing player, choose
  103. Change Player. Whichever player last
  104. played the game will be welcomed on
  105. the next go-around.
  106.  
  107.  
  108. TECHNICAL BLATHER
  109. -----------------
  110.  
  111.     This is the first major use of
  112. DotBASIC for a working entertainment
  113. program. The cards are borrowed from
  114. the great work of the late Maurice
  115. Jones. They are, in my opinion, the
  116. best designed font- graphic cards
  117. ever.
  118.  
  119.     To include the cards in the game,
  120. I monkeyed around with Maurice's
  121. "Michael's Game" to fill a screen with
  122. each suit, then save it. I used VDOT
  123. to touch up the color and tweak a few
  124. pixels, then saved the screens and
  125. font as MED files.
  126.  
  127.     Then, with VOBJECT, I cut out each
  128. card and put it in a Screen Object
  129. Collection file. This is bloaded into
  130. the game and linked. Then each card
  131. can be placed anywhere on the screen
  132. with
  133.  
  134.             .OP,index,x,y.
  135.  
  136.  
  137.     I have left Free Cell unpacked so
  138. you can look at it, and borrow the
  139. CARDS.SOC file for your own solitaires
  140. and other games. Check out the
  141. DotBASIC documentation to see how to
  142. do this.
  143.  
  144.     Since the Event Driver feature of
  145. DotBASIC is not suited for pointing
  146. and clicking cards, I had to use
  147. Region Define (.RD) to create the
  148. columns, free cells, and stack spaces
  149. on the screen. With the Event Driver
  150. disabled (.ED), I could use this
  151. simple bit of code to wait for the
  152. first click or a keypress:
  153.  
  154.    .DO:.MA:.KP,"sux":.UN CR% or I%
  155.  
  156.     After processing the first click,
  157. I use a similar loop to wait for the
  158. second click. The code is very
  159. efficient. Take a look at lines 1100
  160. to 1199.
  161.  
  162.     However, DotBASIC didn't help one
  163. iota when it came to the logic of the
  164. game, which proved to be a real bear!
  165. I had hoped to devise a way to
  166. literally move columns of cards, one
  167. card at a time to free cells and empty
  168. columns until all could be placed on
  169. the target column.
  170.  
  171.     Alas, I could not get my head
  172. around the complex recursiveness of
  173. it. I was becoming rather recursive
  174. myself -- using the same simple
  175. Anglo-Saxon words over and over as I
  176. pulled my hair. (I must have been
  177. speaking in tongues, because as a
  178. pastor, I have no idea what those
  179. words mean!)
  180.  
  181.     One of the weird things I learned
  182. is that the progression of the maximum
  183. number cards that can be moved,
  184. depending on how many free cells and
  185. how many open columns is strange:
  186.  
  187. Zero Free Cells:
  188.  
  189.    Column(s) Open     Cards Movable
  190.  
  191.           0                1
  192.           1                2
  193.           2                4
  194.           3                7
  195.           4               11
  196.           5               15
  197.           6               22
  198.  
  199. Each available Free Cell multiplies
  200. these numbers. I put the above table
  201. in an array:
  202.  
  203.            (FC+1)*CZ(COLS)
  204.  
  205.     And all that has to be done is
  206. check that the column is ordered, and
  207. that a movable card is in the column.
  208. This was a whole lot easier than
  209. trying to move individual cards here
  210. and there and back again!
  211.  
  212.     The progression is a second stage
  213. differential of 1:
  214.  
  215.    Progression    Add       Difference
  216.  
  217.         1
  218.                    1
  219.         2                      1
  220.                    2
  221.         4                      1
  222.                    3
  223.         7                      1
  224.                    4
  225.        11                      1
  226.                    5
  227.        16                      1
  228.                    6
  229.        22
  230.  
  231.  and so forth. Compare it to the
  232. differential for Squares:
  233.  
  234.        VAL     SQR      Add   Dif
  235.  
  236.         0       0
  237.                          1
  238.         1       1              2
  239.                          3
  240.         2       4              2
  241.                          5
  242.         3       9              2
  243.                          7
  244.         4      16              2
  245.                          9
  246.         5      25
  247.  
  248.  (I don't know why I didn't pay more
  249. attention to math in high school. I
  250. guess I just wasn't ready then. This
  251. stuff is fascinating!)
  252.  
  253.  
  254. KUDOS
  255. -----
  256.  
  257.     Again (and forever) a big BIG
  258. thanks to Lee Novak, whose Mr.MOUSE is
  259. at the heart of DotBASIC. I haven't
  260. heard from Lee in some time. He may
  261. well have moved on to other things in
  262. life. It happens. But we send him a
  263. LOADSTAR every month -- because his
  264. Mr.MOUSE and LINK/PACK/DISSOLVE Trio
  265. just keep on giving new life to the
  266. C-64.
  267.  
  268.     And this program is dedicated to
  269. the memory of Maurice Jones, the
  270. Acclaimed Master of Card Game
  271. Simulations. Maurice already had a
  272. Free Cell. This version is a tribute
  273. to him.
  274.  
  275.  DMM
  276.  
  277.  
  278.